<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp"%>
<!doctype html>
<html lang="en">
<head>
<title>医用体温表格</title>
<%@ include file="../common/script.jsp"%>
<style type="text/css">
.data-table{
	width:980px;
}
.data-table table{
	width: 100%;
	BORDER-COLLAPSE: collapse;
	font-size:12px;
}
.data-table table td{
	border:1px solid #000;
	BORDER-COLLAPSE: collapse;
	font-size:12px;
}
</style>
</head>
<body style="font-size: 13px;">
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="javascript:window.print();" iconCls="icon-print">打印</a>
<a href="javascript:void(0)" class="easyui-linkbutton"  iconCls="icon-print" onclick="preview(1)">打印预览</a>
<!--startprint1-->
<table style="width:980px;">
	<tr>
		<td colspan="4" align="center"><strong>体&nbsp;&nbsp;&nbsp;&nbsp;温&nbsp;&nbsp;&nbsp;&nbsp;表</strong></td>
	</tr>
	<tr>
		<td width="25%">姓名：${patient.name }</td>
		<td width="25%">入院日期：<fmt:formatDate value="${patient.startTime }" pattern="yyyy-MM-dd"/></td>
		<td width="25%">床号：${bed.name }</td>
		<td width="25%">住院号：<fmt:formatDate value="${patient.startTime }" pattern="yyyyMMddHHmmss"/></td>
	</tr>
</table>
<div class="data-table">
<table style="width:100%;text-align: center" border="1" cellspacing="0" cellpadding="0">
	<tr>
		<td width="10%">住院日数</td>
		<td colspan="${6*distance }">
			${daysIn }
		</td>
	</tr>
	<tr>
		<td>日期</td>
		<c:forEach items="${resultDateList }" var="st">
		<td colspan="6">${st }</td>
		</c:forEach>
	</tr>
	<tr>
		<td>时间</td>
		<c:forEach var="i" begin="1" end="${distance }">
						<td>02</td>
						<td>06</td>
						<td>10</td>
						<td>14</td>
						<td>18</td>
						<td>22</td>
					</c:forEach>
	</tr>
	<tr>
		<td>体温</td>
		<c:forEach var="i" begin="1" end="${6*distance }">
						<td>&nbsp;</td>
		</c:forEach>
	</tr>
	<c:forEach var="tw" begin="0" end="${distance }">
	<tr>
		<td rowspan="5">${42-tw }</td>
		<c:forEach var="i" begin="0" end="${6*distance-1 }">
		<td>
		<c:choose>
			<c:when test="${resultArray[i][tw*5]==1 }">
				●
			</c:when>
			<c:otherwise>
				&nbsp;
			</c:otherwise>
		</c:choose>
		</td>
		</c:forEach>
	</tr>
	<tr>
		<c:forEach var="i" begin="0" end="${6*distance-1 }">
		<td>
		<c:choose>
			<c:when test="${resultArray[i][tw*5+1]==1 }">
				●
			</c:when>
			<c:otherwise>
				&nbsp;
			</c:otherwise>
		</c:choose>
		</td>
		</c:forEach>
	</tr>
	<tr>
		<c:forEach var="i" begin="0" end="${6*distance-1 }">
		<td>
		<c:choose>
			<c:when test="${resultArray[i][tw*5+2]==1 }">
				●
			</c:when>
			<c:otherwise>
				&nbsp;
			</c:otherwise>
		</c:choose>
		</td>
		</c:forEach>
	</tr>
	<tr>
		<c:forEach var="i" begin="0" end="${6*distance-1 }">
		<td>
		<c:choose>
			<c:when test="${resultArray[i][tw*5+3]==1 }">
				●
			</c:when>
			<c:otherwise>
				&nbsp;
			</c:otherwise>
		</c:choose>
		</td>
		</c:forEach>
	</tr>
	<tr>
		<c:forEach var="i" begin="0" end="${6*distance-1 }">
		<td>
		<c:choose>
			<c:when test="${resultArray[i][tw*5+4]==1 }">
				●
			</c:when>
			<c:otherwise>
				&nbsp;
			</c:otherwise>
		</c:choose>
		</td>
		</c:forEach>
	</tr>
	</c:forEach>
</table>
</div>
<!--endprint1-->
<script type="text/javascript">
function preview(oper)         
{  
	if (oper < 10)  
	{  
		bdhtml=window.document.body.innerHTML;//获取当前页的html代码  
		sprnstr="<!--startprint"+oper+"-->";//设置打印开始区域  
		eprnstr="<!--endprint"+oper+"-->";//设置打印结束区域  
		prnhtml=bdhtml.substring(bdhtml.indexOf(sprnstr)+18); //从开始代码向后取html  
  
		prnhtmlprnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));//从结束代码向前取html  
		window.document.body.innerHTML=prnhtml;  
		window.print();  
		window.document.body.innerHTML=bdhtml;  
	} else {  
		window.print();  
	}  
}  
</script>
</body>
</html>